# Parameters
platform = 'test'

src_dir = '../../src'
build_dir = 'build/'+platform+'/core'
VariantDir(build_dir,src_dir)

test_src_dir='src'
test_build_dir='build/'+platform+'/test'
VariantDir(test_build_dir,test_src_dir)

gtest_home = '..'

flags='-I'+src_dir+'/'+platform+' -I'+src_dir+'/shared -I'+gtest_home+'/include'
link_flags = '-L'+gtest_home+'/lib -lgtest -lgtest_main'

srcs = Split("""
	%(src)s/shared/Packet.cc
	%(src)s/%(platform)s/UART.cc
""" % { 'platform':platform, 'src':build_dir, 'test':test_build_dir })

env=Environment(CCFLAGS=flags,LINKFLAGS=link_flags)
env['ENV']['LD_LIBRARY_PATH'] = gtest_home+'/lib'
test=env.Program([test_build_dir+'/T4-Commands-exerciser.cc']+srcs)
run_alias = env.Alias('run', [test[0]], test[0].path)
AlwaysBuild(run_alias)
